<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/axios.min.js"></script>
    <script src="js/query.js"></script>
    <script>
        window.onload = function () {
            var info = getQuery("errorInfo");
            if (info != null && info == "noland") {
                $("errorDiv").innerHTML = "对不起！请先登录！";
            }
        }

        function land() {
            axios.get("/user/login", {
                params: {
                    userName: $("userName").value,
                    pwd: $("pwd").value
                }
            }).then(resp => {
                var info = resp.data;
                if (info == "ok") {
                    location.href = "/index.html";
                } else {
                    $("errorDiv").innerHTML = "登陆失败";
                }
            })
        }
    </script>
</head>
<body>
<div id="errorDiv" style="color: red"></div>
用户名<input type="text" id="userName"><br>
密码<input type="password" id="pwd"><br>
<input type="button" value="提交" onclick="land()">
</body>
</html>